package com.mryang.ladder;

import java.util.Scanner;

/**
 * @ClassName singleDigitStatistics
 * @Description TODO 统计个位数字出现的次数(1000位以内：即用字符型定义number)
 * @Author Genius
 * @Date 2021/1/19 11:31
 */
public class singleDigitStatistics {
    public static void main(String[] args) {
        String number;
        int num; // 记录个位数字
        int[] count = new int[10]; // 对个位数字进行计数
        Scanner scr = new Scanner(System.in);
//        number = scr.nextInt();
        number = scr.nextLine();
        for (int i = 0; i < number.length(); i++) {
            count[(int)number.charAt(i)-48]++;
        }
        for (int i = 0; i < 10; i++) {
            if (count[i]!=0) {
                System.out.println(i+ ":" + count[i]);
            }
        }
        /*// 方法二
        // 初始化
        for(int i = 0; i< 10;i++){
            count[i] = 0;
        }
        while(number > 0){
            num = (int) number % 10;
            number = number / 10;
            // 计数
            count[num]++;
        }
        for (int i = 0; i < 10; i++) {
            if(count[i]!=0){
                System.out.println(i+ ":" + count[i]);
            }
        }*/
    }
}
